from pydantic import BaseModel
from typing import Union, Generic, Optional, TypeVar

T = TypeVar('T', bound=BaseModel)

class ResponseModel(BaseModel, Generic[T]):
  code: int = 200
  msg: Optional[str] = "success"
  data: Optional[T] = None
  class Config:
    arbitrary_types_allowed = True
